package com.yyh.photo.common;


import lombok.Getter;

/**
 * @Author zhang.huang
 * @Date 2020-4-14 1:02
 **/
// 所有的异常都统一放在这里
@Getter
public enum ResultCodeEnum {

    // 后续可添加状态码 21004 作为业务判定为空类型，要新增从21005开始

    SUCCESS(true,20000,"成功"),
    UNKNOW_REASON(false,20001,"未知错误"),
    BAD_SQL_GRAMMAR(false,21001,"sql语法错误"),
    JSON_PARSE_ERROR(false,21002,"json 解析错误"),
    PARAM_ERROR(false,21003,"参数不正确"),
    METHOD_ARGUMENTTYPEMATCH_ERROR(false,21013,"参数类型错误"),

    TOKEN_ERROR(false,21005,"token不合法，请重新登录"),
    TOKEN_FAILURE(false,21006,"token失效，请重新登录"),

    USER_IS_NONE(false,21007,"用户不存在"),

    FILE_UPLOAD_ERROR(false, 21008, "文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(false, 21009, "Excel数据导入错误"),
    EXCEL_DATA_EMPTY_ERROR(false, 21010, "Excel数据为空"),
	EXCEL_DATA_EXPORT_ERROR(false, 21011, "Excel数据导出错误"),

    FILE_DOWNLOAD_ERROR(false,21012,"文件下载错误"),

    USER_ROLE_INSIDE(false,21013,"内部角色不可删除"),
    FAIL_SUCCESS(false,21015,"部分成功"),
    FAIL_ALL_SUCCESS(false,21016,"转包失败");




    private Boolean success; // 是否响应成功
    private Integer code;    // 响应的状态码
    private String message;  // 响应的消息

    ResultCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }
}
